package spring.jdbc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import spring.bean.Person;

public class JdbcTemBoot {
	
	public static void main(String[] args) {
		Person person=new Person();
		ApplicationContext context=new ClassPathXmlApplicationContext("context.xml", JdbcTemBoot.class);
		JdbcTemplateEventDao eventDao=(JdbcTemplateEventDao) context.getBean("jdbcTemplateEventDao");
		eventDao.init();
		//----------插入----------
//		eventDao.insert();
		
		person.setDes("gozapkaifa");
		person.setName("boxiang");
		eventDao.addBean(person);
		
		//----------查询----------
//		person.setName("姚茗");
//		int size=eventDao.countOfObject(person);
//		System.out.println(size);
		
//		System.out.println(eventDao.queryForList());
		
		//------------查找----------
//		person=eventDao.findPerson(1);
//		System.out.println(person);
		
//		person=eventDao.findPersonSimple(1);
//		System.out.println(person);
		
		//----------打印----------
		System.out.println("over");
	}
	
}
